﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace X23.Util.DateTimeUtil
{
    public static class DateTimeUtil
    {
        /// <summary>
        /// 获取当前中国时间
        /// </summary>
        public static DateTime DateTimeChineseNow { get => DateTime.UtcNow.AddHours(8); }

        /// <summary>
        /// yyyy-MM-dd HH:mm:ss
        /// </summary>
        /// <param name="time"></param>
        /// <returns></returns>
        public static string DateTimeToString(this DateTime time)
        {
            return time.ToString("yyyy-MM-dd HH:mm:ss");
        }
    }
}
